package com.example.camerademoexcercies1.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.camerademoexcercies1.R;

public class MyMenuFragment extends Fragment implements View.OnClickListener {

    private String text_1;
    private String text_2;
    private String text_3;
    private String text_4;
    private String text_5;
    private String text_6;
    private String text_7;
    private String text_8;

    public MyMenuFragment() {
    }

    public MyMenuFragment(String text_1, String text_2, String text_3, String text_4, String text_5, String text_6, String text_7, String text_8) {
        this.text_1 = text_1;
        this.text_2 = text_2;
        this.text_3 = text_3;
        this.text_4 = text_4;
        this.text_5 = text_5;
        this.text_6 = text_6;
        this.text_7 = text_7;
        this.text_8 = text_8;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        核心方法 引入fragment
        View view = inflater.inflate(R.layout.menu_fragment, container, false);
        TextView textView_1 = view.findViewById(R.id.menu_text_1);
        textView_1.setText("相册");
        view.findViewById(R.id.menu_option_1).setOnClickListener(this);
        TextView textView_2 = view.findViewById(R.id.menu_text_2);
        textView_2.setText(text_2);
        TextView textView_3 = view.findViewById(R.id.menu_text_3);
        textView_3.setText(text_3);
        TextView textView_4 = view.findViewById(R.id.menu_text_4);
        textView_4.setText(text_4);
        TextView textView_5 = view.findViewById(R.id.menu_text_5);
        textView_5.setText(text_5);
        TextView textView_6 = view.findViewById(R.id.menu_text_6);
        textView_6.setText(text_6);
        TextView textView_7 = view.findViewById(R.id.menu_text_7);
        textView_7.setText(text_7);
        TextView textView_8 = view.findViewById(R.id.menu_text_8);
        textView_8.setText(text_8);
        return view;
    }


    @Override
    public String toString() {
        return "MyFragment{" +
                "text_1='" + text_1 + '\'' +
                ", text_2='" + text_2 + '\'' +
                ", text_3='" + text_3 + '\'' +
                ", text_4='" + text_4 + '\'' +
                ", text_5='" + text_5 + '\'' +
                ", text_6='" + text_6 + '\'' +
                ", text_7='" + text_7 + '\'' +
                ", text_8='" + text_8 + '\'' +
                '}';
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        if (v.getId() == R.id.menu_option_1) {
        }
    }
}
